package com.example.exceldemo.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @Description
 * @Author xiaohuang
 * @Date 2025/2/24
 */
@NoArgsConstructor
@Data
public class DocFolder {
    private static final long serialVersionUID = 1L;
    /**
     * 主键ID
     */
    private Long id;
    /**
     * 父级节点ID
     */
    private Long parentId;
    /**
     * 文件夹名
     */
    private String name;
    /**
     * 编码值
     */
    private String fid;
    /**
     * 层级名称
     */
    private String fname;
    /**
     * 层级
     */
    private Integer level;
    /**
     * 排序
     */
    private Integer orderNum;

    /**
     * 对应文件夹
     * @param name
     */
    private List<DocFile> files= new ArrayList<>();

    public DocFolder(String name) {
        this.name = name;
    }

    private List<DocFolder> children = new ArrayList<>();

    public void addChild(DocFolder node) {
        children.add(node);
    }
}
